<!DOCTYPE html>
<html>
<head>
	<title>NexHome</title>
    
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	
    <!-- bootstrap -->
    <link href="css/bootstrap/bootstrap.css" rel="stylesheet" />
    <link href="css/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
    <link href="css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />

    <!-- libraries -->
   <link href="css/lib/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css" />
    <link href="css/lib/font-awesome.css" type="text/css" rel="stylesheet" />

    <!-- global styles -->
    <link rel="stylesheet" type="text/css" href="css/layout.css" />
    <link rel="stylesheet" type="text/css" href="css/elements.css" />
    <link rel="stylesheet" type="text/css" href="css/icons.css" />

    <!-- this page specific styles -->
    <link rel="stylesheet" href="css/compiled/new-user.css" type="text/css" media="screen" />    

    <!-- open sans font -->
    <link href='css/OpenSans.css' rel='stylesheet' type='text/css' />

    <!-- lato font -->
    <link href='css/Lato.css' rel='stylesheet' type='text/css' />
	
    <!--[if lt IE 9]>
      <script src="js/html5.js"></script>
    <![endif]--> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>


	<!-- main container -->
    <div class="content">       
        <div class="container-fluid">
         <div id="pad-wrapper" class="new-user">

              <div class="row-fluid header">
                    <h3>登录密码重置</h3>
                </div>

                <div class="row-fluid form-wrapper">
                    <!-- left column -->
                    <div class="span9 with-sidebar">
                        <div class="container">
                            <form id="userAddModalform" class="new_user_form inline-input" />
                                <div class="span12 field-box">
                                    <label>原密码:</label>
                                    <input class="span9"  id="OldPwd" name="account" type="text"  />
                                </div>
                                
                                <div class="span12 field-box">
                                    <label>新密码:</label>
                                    <input class="span9" id="NewPwd"  name="password"  type="text" />
                                </div>
                                
                                <div class="span11 field-box actions">
                                    <input type="button" class="btn-glow primary" id="Changepwdbtn" value="确定" />
                                    <span>OR</span>
                                    <input type="reset" value="取消" class="reset" />
                                </div>
                            </form>
                        </div>
                    </div>

                   
                </div>
				
				
           </div>
        </div>
    </div>
	<!-- end main container -->
	<!-- scripts -->
	<script src="js/jquery-1.10.2.min.js"></script>
    <script src="js/jquery-latest.js"></script>
    <script src="js/bootstrap.min.js"></script>	 
    <script src="js/theme.js"></script>
	<script src="js/bootbox.min.js"></script>
		
   <script>
$(document).ready(function() {
var $buttons = $(".toggle-inputs button");
            var $form = $("form.new_user_form");
			 $form.removeClass("inline-input");
$("#Changepwdbtn").click(function(){
var opwd = $('#OldPwd').val();
var npwd = $('#NewPwd').val();
if(opwd == '' || opwd.length == 0)
{
	bootbox.alert("请输入旧密码", function() {					
							return;
				});
	return;	
}
if(npwd == '' || npwd.length == 0)
{
	bootbox.alert("请输入新密码", function() {					
							return;
				});
	return;
}
$.ajax({ 
		url : '../adminMgr/admin/resetMgrAdminPass',  
		type: 'post',  
		dataType: 'json',
		data: {oldPassword: opwd,newPassword: npwd}, 
		timeout: 100000,  
		cache: false,
		error : function() {
				 alert("获取数据异常，请重新获取"); 
				},   
		success:function(data){
			if(data.resultCode != '10000'){	
				
				bootbox.alert(data.resultMsg, function() {					
						return;
				});	
										
			}
			else{
				
				bootbox.alert("密码修改成功，请重新登录", function() {					
					window.top.location.href = "sign-in.html";
				});	
				
			}
			
		}  
		
	});  
});
});
</script>
	
</body>
</html>